<?php 
       $tbl_menu        = new Default_Model_menu();
       $data_menu       = $tbl_menu->get_menu();
      
     
     
?>
 <!--Begin div menu-->
             <div class="main_menu">
                    <div id="smoothmenu1" class="ddsmoothmenu">
					       <ul>
					         <?php
					              foreach ($data_menu as $val){ 
					                   $link_parent=$tbl_menu-> get_link($id=$val['id'], $type=$val['type'], $title=$val['title'], $key_id=$val['keyt_id']);
					         	    
					        ?>
					            <li><a href="<?php echo  $link_parent; ?>"><?php echo $val['title']; ?></a>
					                  <ul>
						                  <?php 
						                     $child = $tbl_menu->get_child($val['id']);
						                    
						                     foreach ($child as $value){
						                     	 echo $value['key_id'];
						                     	  $link_child=$tbl_menu-> get_link($id=$value['id'], $type=$value['type'], $title=$this->FunctionPublic($value['title']), $key_id=$value['keyt_id']);
						                          
						                  ?>
						                  <li><a href="<?php echo $link_child; ?>"><?php echo $value['title']; ?></a></li>
						                  <?php }?>
						                  
					                  </ul>
					            </li>
					           <?php }?> 
					        </ul>
					        <br style="clear:both;" />
                      </div>
                     
              </div>
        <!--Begin div menu-->